package com.wt.admin.domain.entity.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.wt.admin.domain.entity.PublicEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@TableName(value = "sys_setting",autoResultMap = true)
public class SysSettingEntity extends PublicEntity {

    @TableField(value = "user",typeHandler = JacksonTypeHandler.class)
    private User user;
    @TableField(value = "application",typeHandler = JacksonTypeHandler.class)
    private Application application;

    @Data
    public static class User implements Serializable {
        private Integer accountLength = 5;
        private Integer passwordLength = 6;
        private List<Integer> passwordLever = new ArrayList<>();
        private String passwordInit;
        // 密码失效（天）
        private Integer passwordExpired = 180;
        // token失效（天）
        private Integer tokenExpired = 1;
        private Boolean forcedModification = false;

        private Integer errorCount = 5;
        private Integer closedTime = 30;
    }

    @Data
    public static class Application implements Serializable {
        // 操作日志保留时长（天）
        private Integer operationLogStored = 180;

    }

}
